<template>
  <div>
    <template v-for="item in router" >
      <el-submenu index="1" :index="item.name" :key="item.id" v-if="item.children.length > 0">
        <template slot="title">
          <i style="color: #409eff;margin-right: 5px" :class="item.iconCls"></i>
          <span>{{item.name}}</span>
        </template>
        <Menu :router="item.children"></Menu>
      </el-submenu>
      <el-menu-item v-else :index="item.path" :key="item.id">
        <i style="color: #409eff;margin-right: 5px" :class="item.iconCls"></i>
        <span>{{item.name}}</span>
      </el-menu-item>
    </template>
  </div>
</template>

<script>
    export default {
      name: "Menu",
      props: ["router"]
    }
</script>

<style scoped>

</style>
